// @ts-ignore
/* eslint-disable */
import {request} from 'umi';


/** currentUser GET /api/user/current */
export async function currentUserUsingGET(options?: { [key: string]: any }) {
  return request<API.BaseResponseUser>('/api/user/current', {
    method: 'GET',
    ...(options || {}),
  });
}

/** getUserById GET /api/user/get */
export async function getUserByIdUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getUserByIdUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseUser>('/api/user/get', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** userLogin POST /api/user/login */
export async function userLoginUsingPOST(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.userLoginUsingPOSTParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseUser>('/api/user/login', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** userLogout GET /api/user/logout */
export async function userLogoutUsingGET(options?: { [key: string]: any }) {
  return request<API.BaseResponseUser>('/api/user/logout', {
    method: 'GET',
    ...(options || {}),
  });
}

export async function getPublicKey(options?: { [key: string]: any }) {
  return request<API.BaseResponseString_>('/api/user/getPublicKey', {
    method: 'POST',
    ...(options || {}),
  });
}

export async function getSecretKeyUsingPost(
  body: string,
  options?: { [key: string]: any }) {
  return request<API.BaseResponseString_>('/api/user/getSecretKey', {
    method: 'POST',
    ...(options || {}),
    data: body
  });
}

/** registerUser POST /api/user/register */
export async function registerUserUsingPOST(
  body: API.UserAddRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseUser>('/api/user/register', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
